/**  

* @author renbangjie renbangjie@126.com  
* @version V1.0  
*/
package com.ai.service.reviewed.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ai.common.core.mapper.Mapper;
import com.ai.common.core.service.impl.BaseServiceImpl;
import com.ai.mmd.reviewed.dto.DlxxDTO;
import com.ai.service.reviewed.dao.DlxxModelMapper;
import com.ai.service.reviewed.model.DlxxModel;
import com.ai.service.reviewed.service.IDlxxService;

/**
* 
*	登陆信息的业务实现类
* 
* @author renbangjie renbangjie@126.com
*/
@Service("idlxxService")
public class DlxxServiceImpl extends BaseServiceImpl<DlxxModel>
		implements IDlxxService {

	/**
	 * 判断该用户的合法性
	 * 
	 * @param 登录id,令牌
	 * @return 0:匹配  1:不匹配
	 * @throws Exception
	 */
	public int isUserMarch(String id,String token)throws Exception {
		
		int nRet = 0;
		
		DlxxDTO dlxx = new DlxxDTO();
		dlxx.setYhid(id);
		dlxx.setToken(token);
		
		DlxxModel dlxxModel = dlxxModelMapper.getOne(dlxx);
		if(dlxxModel==null)
		{
			nRet = 1;
		}
		
		return nRet;
	}

	
	@Resource(name = "dlxxModelMapper")
	private DlxxModelMapper dlxxModelMapper;
	
	@Override
	protected Mapper<DlxxModel> getMapper() {
		return dlxxModelMapper;
	}

}
